home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / GXEnvironment.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  7.4 KB  |  342 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        GXEnvironment.a
  3. ;
  4. ;    Contains:    QuickDraw GX environment constants and interfaces
  5. ;
  6. ;    Version:    Technology:    Quickdraw GX 1.1
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__GXENVIRONMENT__') = 'UNDEFINED' THEN
  21. __GXENVIRONMENT__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  25.     include 'ConditionalMacros.a'
  26.     ENDIF
  27.  
  28.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  29.     include 'MixedMode.a'
  30.     ENDIF
  31. ;        include 'Types.a'                                            ;
  32.  
  33.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  34.     include 'Windows.a'
  35.     ENDIF
  36. ;        include 'Memory.a'                                            ;
  37. ;        include 'Quickdraw.a'                                        ;
  38. ;            include 'QuickdrawText.a'                                ;
  39. ;        include 'Events.a'                                            ;
  40. ;            include 'OSUtils.a'                                    ;
  41. ;        include 'Controls.a'                                        ;
  42. ;            include 'Menus.a'                                        ;
  43.  
  44.     IF &TYPE('__GXTYPES__') = 'UNDEFINED' THEN
  45.     include 'GXTypes.a'
  46.     ENDIF
  47. ;        include 'GXMath.a'                                            ;
  48. ;            include 'FixMath.a'                                    ;
  49.     graphicsMacintoshIncludes: SET 1
  50.  
  51. defaultPollingHandlerFlags        EQU        $00
  52. okToSwitchDuringPollFlag        EQU        $00
  53. dontSwitchDuringPollFlag        EQU        $01
  54.  
  55. ; typedef long                 gxPollingHandlerFlags
  56. ;
  57. ; gxPollingHandlerUPP GXGetGraphicsPollingHandler(long *reference)
  58. ;
  59.     IF ¬ GENERATINGCFM THEN
  60.         Macro
  61.         _GXGetGraphicsPollingHandler
  62.             move.w    #$245,d0
  63.             dc.w     $A832
  64.         EndM
  65.     ELSE
  66.         IMPORT_CFM_FUNCTION    GXGetGraphicsPollingHandler
  67.     ENDIF
  68.  
  69. ;
  70. ; void GXSetGraphicsPollingHandler(gxPollingHandlerUPP handler, long reference)
  71. ;
  72.     IF ¬ GENERATINGCFM THEN
  73.         Macro
  74.         _GXSetGraphicsPollingHandler
  75.             move.w    #$246,d0
  76.             dc.w     $A832
  77.         EndM
  78.     ELSE
  79.         IMPORT_CFM_FUNCTION    GXSetGraphicsPollingHandler
  80.     ENDIF
  81.  
  82.     graphicsToolboxIncludes: SET 1
  83. ; QD to QD GX Translator typedefs 
  84.  
  85. gxDefaultOptionsTranslation        EQU        $0000
  86. gxOptimizedTranslation            EQU        $0001
  87. gxReplaceLineWidthTranslation    EQU        $0002
  88. gxSimpleScalingTranslation        EQU        $0004
  89. gxSimpleGeometryTranslation        EQU        $0008                ; implies simple scaling 
  90. gxSimpleLinesTranslation        EQU        $000C                ; implies simple geometry & scaling 
  91. gxLayoutTextTranslation            EQU        $0010                ; turn on gxLine layout (normally off) 
  92. gxRasterTargetTranslation        EQU        $0020
  93. gxPostScriptTargetTranslation    EQU        $0040
  94. gxVectorTargetTranslation        EQU        $0080
  95.  
  96. ; typedef long                 gxTranslationOption
  97.  
  98. gxContainsFormsBegin            EQU        $0001
  99. gxContainsFormsEnd                EQU        $0002
  100. gxContainsPostScript            EQU        $0004
  101. gxContainsEmptyPostScript        EQU        $0008
  102.  
  103. ; typedef long                 gxTranslationStatistic
  104.  
  105. gxQuickDrawPictTag                EQU        'pict'
  106.  
  107. gxQuickDrawPict         RECORD    0
  108. ; translator inputs 
  109. options                     ds.l   1        ; offset: $0 (0)
  110. srcRect                     ds     Rect    ; offset: $4 (4)
  111. styleStretch             ds     Point    ; offset: $C (12)
  112. ; size of quickdraw picture data 
  113. dataLength                 ds.l   1        ; offset: $10 (16)
  114. ; file alias 
  115. alias                     ds     gxBitmapDataSourceAlias ; offset: $14 (20)
  116. sizeof                     EQU *            ; size:   $1E (30)
  117.                         ENDR
  118.  
  119. ; typedef struct gxQuickDrawPict  gxQuickDrawPict
  120. ; WindowRecord utilities 
  121. ;
  122. ; gxViewPort GXNewWindowViewPort(WindowPtr qdWindow)
  123. ;
  124.     IF ¬ GENERATINGCFM THEN
  125.         Macro
  126.         _GXNewWindowViewPort
  127.             move.w    #$236,d0
  128.             dc.w     $A832
  129.         EndM
  130.     ELSE
  131.         IMPORT_CFM_FUNCTION    GXNewWindowViewPort
  132.     ENDIF
  133.  
  134. ;
  135. ; gxViewPort GXGetWindowViewPort(WindowPtr qdWindow)
  136. ;
  137.     IF ¬ GENERATINGCFM THEN
  138.         Macro
  139.         _GXGetWindowViewPort
  140.             move.w    #$237,d0
  141.             dc.w     $A832
  142.         EndM
  143.     ELSE
  144.         IMPORT_CFM_FUNCTION    GXGetWindowViewPort
  145.     ENDIF
  146.  
  147. ;
  148. ; WindowPtr GXGetViewPortWindow(gxViewPort portOrder)
  149. ;
  150.     IF ¬ GENERATINGCFM THEN
  151.         Macro
  152.         _GXGetViewPortWindow
  153.             move.w    #$238,d0
  154.             dc.w     $A832
  155.         EndM
  156.     ELSE
  157.         IMPORT_CFM_FUNCTION    GXGetViewPortWindow
  158.     ENDIF
  159.  
  160. ; GDevice utilities 
  161. ;
  162. ; GDHandle GXGetViewDeviceGDevice(gxViewDevice theDevice)
  163. ;
  164.     IF ¬ GENERATINGCFM THEN
  165.         Macro
  166.         _GXGetViewDeviceGDevice
  167.             move.w    #$239,d0
  168.             dc.w     $A832
  169.         EndM
  170.     ELSE
  171.         IMPORT_CFM_FUNCTION    GXGetViewDeviceGDevice
  172.     ENDIF
  173.  
  174. ;
  175. ; gxViewDevice GXGetGDeviceViewDevice(GDHandle qdGDevice)
  176. ;
  177.     IF ¬ GENERATINGCFM THEN
  178.         Macro
  179.         _GXGetGDeviceViewDevice
  180.             move.w    #$23a,d0
  181.             dc.w     $A832
  182.         EndM
  183.     ELSE
  184.         IMPORT_CFM_FUNCTION    GXGetGDeviceViewDevice
  185.     ENDIF
  186.  
  187. ; gxPoint utilities 
  188. ;
  189. ; void GXConvertQDPoint(const Point *shortPt, gxViewPort portOrder, gxPoint *fixedPt)
  190. ;
  191.     IF ¬ GENERATINGCFM THEN
  192.         Macro
  193.         _GXConvertQDPoint
  194.             move.w    #$23b,d0
  195.             dc.w     $A832
  196.         EndM
  197.     ELSE
  198.         IMPORT_CFM_FUNCTION    GXConvertQDPoint
  199.     ENDIF
  200.  
  201. ; printing utilities typedef 
  202. ; typedef gxShapeSpoolProcPtr  gxShapeSpoolFunction
  203. ; typedef gxUserViewPortFilterProcPtr  gxUserViewPortFilter
  204. ; typedef gxConvertQDFontProcPtr  gxConvertQDFontFunction
  205. ; mouse utilities 
  206. ; return mouse location in fixed-gxPoint global space 
  207. ;
  208. ; void GXGetGlobalMouse(gxPoint *globalPt)
  209. ;
  210.     IF ¬ GENERATINGCFM THEN
  211.         Macro
  212.         _GXGetGlobalMouse
  213.             move.w    #$23c,d0
  214.             dc.w     $A832
  215.         EndM
  216.     ELSE
  217.         IMPORT_CFM_FUNCTION    GXGetGlobalMouse
  218.     ENDIF
  219.  
  220. ; return fixed-gxPoint local mouse (gxViewPort == 0 --> default) 
  221. ;
  222. ; void GXGetViewPortMouse(gxViewPort portOrder, gxPoint *localPt)
  223. ;
  224.     IF ¬ GENERATINGCFM THEN
  225.         Macro
  226.         _GXGetViewPortMouse
  227.             move.w    #$23d,d0
  228.             dc.w     $A832
  229.         EndM
  230.     ELSE
  231.         IMPORT_CFM_FUNCTION    GXGetViewPortMouse
  232.     ENDIF
  233.  
  234. ; printing utilities 
  235. ;
  236. ; gxUserViewPortFilter GXGetViewPortFilter(gxViewPort portOrder, long *refCon)
  237. ;
  238.     IF ¬ GENERATINGCFM THEN
  239.         Macro
  240.         _GXGetViewPortFilter
  241.             move.w    #$25e,d0
  242.             dc.w     $A832
  243.         EndM
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION    GXGetViewPortFilter
  246.     ENDIF
  247.  
  248. ;
  249. ; void GXSetViewPortFilter(gxViewPort portOrder, gxUserViewPortFilter filter, long refCon)
  250. ;
  251.     IF ¬ GENERATINGCFM THEN
  252.         Macro
  253.         _GXSetViewPortFilter
  254.             move.w    #$23e,d0
  255.             dc.w     $A832
  256.         EndM
  257.     ELSE
  258.         IMPORT_CFM_FUNCTION    GXSetViewPortFilter
  259.     ENDIF
  260.  
  261. ; QD to QD GX Translator functions 
  262. ;
  263. ; void GXInstallQDTranslator(GrafPtr port, gxTranslationOption options, const Rect *srcRect, const Rect *dstRect, Point styleStrech, gxShapeSpoolUPP userFunction, void *reference)
  264. ;
  265.     IF ¬ GENERATINGCFM THEN
  266.         Macro
  267.         _GXInstallQDTranslator
  268.             move.w    #$23f,d0
  269.             dc.w     $A832
  270.         EndM
  271.     ELSE
  272.         IMPORT_CFM_FUNCTION    GXInstallQDTranslator
  273.     ENDIF
  274.  
  275. ;
  276. ; gxTranslationStatistic GXRemoveQDTranslator(GrafPtr port, gxTranslationStatistic *statistic)
  277. ;
  278.     IF ¬ GENERATINGCFM THEN
  279.         Macro
  280.         _GXRemoveQDTranslator
  281.             move.w    #$240,d0
  282.             dc.w     $A832
  283.         EndM
  284.     ELSE
  285.         IMPORT_CFM_FUNCTION    GXRemoveQDTranslator
  286.     ENDIF
  287.  
  288. ;
  289. ; gxShape GXConvertPICTToShape(PicHandle pict, gxTranslationOption options, const Rect *srcRect, const Rect *dstRect, Point styleStretch, gxShape destination, gxTranslationStatistic *stats)
  290. ;
  291.     IF ¬ GENERATINGCFM THEN
  292.         Macro
  293.         _GXConvertPICTToShape
  294.             move.w    #$241,d0
  295.             dc.w     $A832
  296.         EndM
  297.     ELSE
  298.         IMPORT_CFM_FUNCTION    GXConvertPICTToShape
  299.     ENDIF
  300.  
  301. ; Find the best GX style given a QD font and face. Called by the QD->GX translator 
  302. ;
  303. ; long GXConvertQDFont(gxStyle theStyle, long txFont, long txFace)
  304. ;
  305.     IF ¬ GENERATINGCFM THEN
  306.         Macro
  307.         _GXConvertQDFont
  308.             move.w    #$242,d0
  309.             dc.w     $A832
  310.         EndM
  311.     ELSE
  312.         IMPORT_CFM_FUNCTION    GXConvertQDFont
  313.     ENDIF
  314.  
  315. ;
  316. ; gxConvertQDFontUPP GXGetConvertQDFont(void)
  317. ;
  318.     IF ¬ GENERATINGCFM THEN
  319.         Macro
  320.         _GXGetConvertQDFont
  321.             move.w    #$243,d0
  322.             dc.w     $A832
  323.         EndM
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION    GXGetConvertQDFont
  326.     ENDIF
  327.  
  328. ;
  329. ; void GXSetConvertQDFont(gxConvertQDFontUPP userFunction)
  330. ;
  331.     IF ¬ GENERATINGCFM THEN
  332.         Macro
  333.         _GXSetConvertQDFont
  334.             move.w    #$244,d0
  335.             dc.w     $A832
  336.         EndM
  337.     ELSE
  338.         IMPORT_CFM_FUNCTION    GXSetConvertQDFont
  339.     ENDIF
  340.  
  341.     ENDIF ; __GXENVIRONMENT__
  342.